<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增项目')" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-project-add">
			<div class="form-group">
				<label class="col-sm-3 control-label ">项目名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="pname" id="pname" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">项目时间：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="starttime" id="starttime" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">项目图纸：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="drawing" id="drawing" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">效果图：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="picture" id="picture" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">材料清单：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="materials" id="materials" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">项目详情：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="details" id="details" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">项目简介：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="pdesc" id="pdesc" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">项目负责人：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="pmanager" id="pmanager" required>
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: ztree-js" />
	<script type="text/javascript">
	    /*$(function() {
			var url = ctx + "system/menu/roleMenuTreeData";
			var options = {
				id: "menuTrees",
		        url: url,
		        check: { enable: true },
		        expandLevel: 0
		    };
			$.tree.init(options);
		});*/

		var prefix = ctx + "knowledge/project"

		$("#form-project-add").validate({
			/*rules:{
				onkeyup: false,
				pname:{
					remote: {
						url: ctx + "cms/knowledge/checkProjectNameUnique",
						type: "post",
						dataType: "json",
						data: {
							"pname" : function() {
								return $.common.trim($("#pname").val());
							}
						},
						dataFilter: function(data, type) {
							return $.validate.unique(data);
						}
					}
				},

				roleSort:{
					digits:true
				},
			},
			messages: {
				"pname": {
					remote: "项目名称已经存在"
				},
			},*/
			focusCleanup: true
		});
		
		function submitHandler() {
			if ($.validate.form()) {
				$.operate.save(prefix + "/add", $('#form-project-add').serialize());
			}
	    }
	
		/*function add() {
			var pname = $("input[name='pname']").val();
			var tname = $("input[name='tname']").val();

			$.ajax({
				cache : true,
				type : "POST",
				url : ctx + "notice/type/add",
				data : {
					"tname": tname,
					"tdesc": tdesc,

				},
				async : false,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}*/
	</script>
</body>
</html>
